<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>lxp_test</title>
		
    <!-- bootstrap.css -->
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">  
    <!-- jquery -->
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <!-- bootstrap.js -->
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  	<!-- angular -->
  	<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
  	<!-- jquery-validation 表单验证-->
  	<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
		<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script>

  </head>
  <body>
    <script>
    	// for the purpose of this example let's assume that variables `$q`, `scope` and `okToGreet`
  // are available in the current lexical scope (they could have been injected or passed in).
var app = angular.module("app",[]);
app.controller("appCtrl",function($scope,$q){
//	
//function asyncGreet(name) {
//	console.log(name)
//  var deferred = $q.defer();
//
//  setTimeout(function() { 
//    // since this fn executes async in a future turn of the event loop, we need to wrap
//    // our code into an $apply call so that the model changes are properly observed.
//    $scope.$apply(function() {
//      deferred.notify('About to greet ' + name + '.');
//
//      if (okToGreet(name)) {
//        deferred.resolve('Hello, ' + name + '!');
//      } else {
//        deferred.reject('Greeting ' + name + ' is not allowed.');
//      }
//    });
//  }, 1000);
// 
//  return deferred.promise;
//}
//
//var promise = asyncGreet('Robin Hood');
//promise.then(function(greeting) {
//  alert('Success: ' + greeting);
//}, function(reason) { 
//  alert('Failed: ' + reason);
//}, function(update) {
//  alert('Got notification: ' + update);
//}); 
//
//
// });
    </script>

  <div ng-app="app" ng-controller="appCtrl">
  	
  </div>
  </body>
</html>